<%@ page import="java.net.URLDecoder" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/pages/common/common.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>修改报表</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <script type="text/javascript" src="<%=request.getContextPath()%>/scripts/page/editRpt.js"></script>
        <link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/layui/css/layui.css" media="all">
        <script src="<%=request.getContextPath()%>/plugins/layui/layui.js"></script>

        <style type="text/css">
            .mask {
                position: absolute; top: 0px; filter: alpha(opacity=60); background-color: #777;
                z-index: 1002; left: 0px;
                opacity:0.5; -moz-opacity:0.5;
            }
        </style>
        <script type="application/javascript">
            var basePath = "${pageContext.request.contextPath}";
        </script>
    </head>
    <body>
    <div id="mask" class="mask"></div>
    <input type="hidden" id="rptId" name="rptId" value="${rptId}">
    <input type="hidden" id="sysCode" name="sysCode" value="${sysCode}">
    <input type="hidden" id="dbName" name="dbName" value="${encodedb}">
    <input type="hidden" id="rptHeaderJson" name="rptHeaderJson">
    <input type="hidden" id="xmlCheck" name="xmlCheck">
    <div class="ui-form" style="width: 130%; padding-top: 50px;">
            <form id="rptForm" enctype="multipart/form-data">
                <div class="ui-form-row">
                    <span class="base-tr ui-form-left">报表名称：</span>
                    <div class="ui-form-right" style="padding-top:5px;">
                        <input class="ui-input-text" id="rptName" name="rptName" type="text" style="width: 400px;" value="${encodeName}" />
                        <font color="red">*</font>
                    </div>
                </div>
                <div class="ui-form-row">
                    <span class="base-tr ui-form-left">数据源：</span>
                    <div class="ui-form-right">
                        <select class="ui-select" id="dbSource" name="dbSource" style="width: 400px;">
                        </select>
                        <font color="red">*</font>
                    </div>
                </div>
                <div class="ui-form-row">
                    <span class="base-tr ui-form-left">接入系统：</span>
                    <div class="ui-form-right">
                        <select class="ui-select" id="accessIn" name="accessIn" style="width: 400px;">
                        </select>
                    </div>
                </div>
                <div class="ui-form-row">
                    <span class="base-tr ui-form-left">是否修改表头：</span>
                    <div class="ui-form-right">
                        <select class="ui-select" id="modifyChk" name="modifyChk" style="width: 400px;">
                            <option value="0">否</option>
                            <option value="1">是</option>
                        </select>
                    </div>
                </div>
                <div class="ui-form-row" id="divRptHeader" style="display: none;">
                    <span class="base-tr ui-form-left">报表表头：</span>
                    <div class="ui-form-right">
                        <input class="ui-input-text" type="text" id="rptHeaderInput" name="rptHeaderInput"
                               placeholder="点击上传.." readonly="readonly" style="width: 400px;" onclick="$('#rptHeader').click();"/>
                        <input name="rptHeader" id="rptHeader" type="file" style="display: none;"
                               onchange="$('#rptHeaderInput').val($(this).val());" />
                        <input class="ui-btn ui-btn-blue" type="button" value="报表表头上传" onclick="editRpt.uploadeRptHeader()" />
                        <a id="downRptCfg" onclick="editRpt.downLoadRptCfg();" href="#" style="color: #4697e5; text-decoration:none; font-size: 14px;font-family: '微软雅黑';display: none;">下载报表配置模板</a>
                    </div>
                </div>
                <div class="ui-form-row">
                    <span class="base-tr ui-form-left">报表配置：</span>
                    <div class="ui-form-right">
                        <input class="ui-input-text" type="text" id="rptCfgInput" name="rptCfgInput"
                               placeholder="点击上传.." readonly="readonly" style="width: 400px;" onclick="$('#rptCfg').click();"/>
                        <input name="rptCfg" id="rptCfg" type="file" style="display: none;"
                               onchange="$('#rptCfgInput').val($(this).val());" />
                        <input class="ui-btn ui-btn-blue" type="button" value="报表配置上传" onclick="editRpt.uploadRptCfg()" />
                        <a id="preViewSQL" onclick="editRpt.preViewSQL();" href="#" style="color: #4697e5; text-decoration:none; font-size: 14px;font-family: '微软雅黑';display: none;">&nbsp;预览报表SQL</a>
                    </div>
                </div>
                <div class="ui-form-row">
                    <span class="base-tr ui-form-left base-vh">null:</span>
                    <div class="ui-form-right">
                        <input class="ui-btn ui-btn-blue" type="button" style="width: 150px;" onclick="editRpt.editRpt();" value="修改报表" />
                    </div>
                </div>
                <div class="ui-form-row">
                    <span class="base-tr ui-form-left base-vh" style="width: 25%">null：</span>
                    <div class="ui-form-right" style="width: 75%;font-size: 12px;color: grey;">
                        注：设置接入系统后，浏览器无法直接打开报表链接，报表只能通过接入系统访问;
                        如果报表需要离线下载和<br>自定义报表功能则必须配置接入系统，且接入系统需提供相关服务
                    </div>
                </div>
            </form>
        </div>

        <script>
            layui.use(['layer'], function(){
                var layer = layui.layer;
            });
        </script>
    </body>
</html>
